<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:c="http://www.xidea.org/ns/lite/core">
	<head>
		<meta http-equiv="content-type"
			content="text/html; charset=UTF-8" />
		<title>CDN 脚本列表</title>
		<link type="text/css" rel="Stylesheet" href="/styles/default.css" />
    	<style>
		label{
			width:200px;
			white-space: no-wrap;
			display:inline-block;
		}
		</style>
	</head>
	<body>
		<script>
	/*<![CDATA[*/
	function gen(showDoc){
		paths = document.forms[0].paths;
		var url = window.location.href;
		url = url.substring(0,url.lastIndexOf('/')+1)
		var buf = [];
		for(var i=0;i<paths.length;i++){
			var path = paths[i];
			if(path.checked){
				buf.push(path.value)
			}
		}
		if(buf.length ==0){
			confirm("请选择类库")
		}else if(showDoc){
			var pkg = {};
			var buf2 = [];
			for(var i=0;i<buf.length;i++){
				var item = buf[i].replace(/\:.*/,'');
				if(pkg[item]!=true){
					pkg[item] = true;
					buf2.push(item);
				}
			}
			pkg = buf2.join('","')
			window.open(url+'org/xidea/jsidoc/index.html?group={"example":["'+pkg+'"]}');
		}else{
			window.open(url+'='+buf.join('+'));
		}
	}
	function doCheck(parentNode,checked){
		var inputs = parentNode.getElementsByTagName('input');
		for(var i = inputs.length-1;i>=0;i--){
			inputs[i].checked = checked;
		}
	}
	/*]]>*/
	</script>
		<h1>可选脚本</h1>
		<form onsubmit="return false">
			<input type="button" onclick="gen(false)" value="生成脚本路径" />
			<input type="button" onclick="gen(true)" value="查看JSIDoc" />
			<hr />
			<c:for var="pkg" items="${packageList}">
				<c:if
					test="${!pkg.name.startsWith('org.xidea.jsidoc')}">
					<div style="padding:10px;">
						<div>
							<input
								onclick="doCheck(this.parentNode.parentNode,this.checked)"
								type="checkbox" />
							<strong>${pkg.name}</strong>
						</div>
						<c:for var="object"
							items="${pkg.objectScriptMap.keySet()}">
							<label>
								<input name="paths" type="checkbox"
									value="${pkg.name+':'+object}" />
								${object}
							</label>
						</c:for>
						<hr />
					</div>
				</c:if>
			</c:for>
			<input type="button" onclick="gen(false)" value="生成脚本路径" />
			<input type="button" onclick="gen(true)" value="查看JSIDoc" />
		</form>

	</body>
</html>
